<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>修改密码--layui后台管理模板 2.0</title>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="format-detection" content="telephone=no"/>
    <link href="/resource/css/index.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="/resource/common/layui/css/layui.css" media="all"/>
</head>
<style>
    .main #test5 {
        margin-top: 20px;
        margin-left: 40px;
    }
</style>
<body class="index">

<div class="layui-form" style="margin:auto;margin-top:10px">
    <div class="top">
        <div class="main">
            <div id="contentMain" style="width: 550px;margin-top: 20px;margin-left: 40px">
                <textarea id="editor" placeholder="请输入退款原因" class=" layui-textarea" name="content"
                          style="height: 200px"></textarea>
            </div>
        </div>
        <div class="notice_bot">
            <div class="r_right but_p">
                <button class="but_save layui-btn" lay-submit="" lay-filter="Submit" style="padding: 0">提交
                </button>
                <button class="but_close" onclick="Cancel()">关闭</button>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="/resource/common/layui/layui.js"></script>
<script type="text/javascript" th:inline="javascript">


    layui.use(['table', 'layer', 'upload', 'rate', 'form', 'layedit'], function () {
        var table = layui.table,
            $ = layui.$,
            layer = layui.layer,
            rate = layui.rate,
            layedit = layui.layedit,
            upload = layui.upload,
            form = layui.form;
        Cancel = function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        }
        var orderId = [[${orderId}]]
        form.on('submit(Submit)', function (data) {
            data.field.orderId = orderId
            $.ajax({
                url: '/front/salesReturn.do',
                type: 'post',
                data: data.field,
                dataType: 'json',
                async: false,
                success: function (result) {
                    if (!result.status) {
                        parent.layer.msg(result.msg, {time: 2000});
                        return false;
                    } else {
                        parent.layer.msg("成功!", {time: 1000});
                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                        parent.layui.table.reload('house-user-order', {});
                        parent.active.reload()
                    }
                }

            });
        });
    });

</script>

</body>
</html>